<template lang="jade">

lists-view(:list="lists", @list-click="listOnClick")

</template>

<script>
  import listsView from 'lists.vue'
  import componentsList from '../data/componentsList'
  import router from '../index'

  export default {
    components: {
      listsView
    },
    data() {
      return {
        lists: componentsList
      }
    },
    methods: {
      listOnClick(index) {
        // router.go(this.lists[index].title)
        router.go({
          path: this.lists[index].title,
          params: {
            navbarTitle: this.lists[index].title
          }
        })
        this.$dispatch('title-change', this.lists[index].title)
        console.log(this.lists[index].title);
      }
    }
  }
</script>

<style lang="less">

</style>
